import request from '@/utils/request'

let ProductApi = {

  /*分类管理*/
  catList(data, errorback) {
    return request._post('/shop/product.category/index', data, errorback);
  },
  /*分类添加*/
  catAdd(data, errorback) {
    return request._post('/shop/product.category/add', data, errorback);
  },
  /*分类删除*/
  catDel(data, errorback) {
    return request._post('/shop/product.category/delete', data, errorback);
  },
  /*分类修改*/
  catEdit(data, errorback) {
    return request._post('/shop/product.category/edit', data, errorback);
  },
  /*分类审核*/
  auditStatusSubmit(data, errorback) {
    return request._post('/shop/product.category/audit', data, errorback);
  },
  /*产品列表*/
  productList(data, errorback) {
    return request._post('/shop/product.product/index', data, errorback);
  },
  /*产品选择列表*/
  chooseLists(data, errorback) {
    return request._post('/shop/data.product/lists', data, errorback);
  },
  /*规格选择列表*/
  chooseSpec(data, errorback) {
    return request._post('/shop/data.product/spec', data, errorback);
  },
  /*新增产品*/
  addProduct(data, errorback) {
    return request._post('/shop/product.product/add', data, errorback);
  },

  /*产品基础数据*/
  getBaseData(data, errorback) {
    return request._get('/shop/product.product/add', data, errorback);
  },
  /*删除产品*/
  delProduct(data, errorback) {
    return request._post('/shop/product.product/delete', data, errorback);
  },
  /*产品基础数据*/
  getEditData(data, errorback) {
    return request._get('/shop/product.product/edit', data, errorback);
  },
  /*新增产品*/
  editProduct(data, errorback) {
    return request._post('/shop/product.product/edit', data, errorback);
  },
  /* 审核产品 */
  auditProduct(data, errorback) {
    return request._post('/shop/product.product/audit', data, errorback);
  },
  /*新增规格组*/
  addSpec(data, errorback) {
    return request._post('/shop/product.spec/addSpec', data, errorback);
  },
  /*新增规格值*/
  addSpecValue(data, errorback) {
    return request._post('/shop/product.spec/addSpecValue', data, errorback);
  },
  /*商品列表不带分页*/
  getList(data, errorback) {
    return request._post('/shop/data.product/lists', data, errorback);
  },
  /*商品列表不带分页*/
  getActiveProductList(data, errorback) {
    return request._post('/shop/plus.fans.product/lists', data, errorback);
  },
  /*商品评论列表*/
  getCommentList(data, errorback) {
    return request._post('/shop/product.comment/index', data, errorback);
  },
  /*获取评论详情*/
  getComment(data, errorback) {
    return request._post('/shop/product.comment/detail', data, errorback);
  },
  /*获取评论详情*/
  editComment(data, errorback) {
    return request._post('/shop/product.comment/edit', data, errorback);
  },
  /*删除评论*/
  delComment(data, errorback) {
    return request._post('/shop/product.comment/delete', data, errorback);
  },
  /*得到分类图片*/
  cateImage(data, errorback) {
    return request._post('/shop/product.category/image', data, errorback);
  },
  /*修改状态*/
  changeStatus(data, errorback) {
    return request._post('/shop/product.product/state', data, errorback);
  },
  /*商品模板*/
  addTemplate(data, errorback) {
    return request._post('/shop/product.product_template/createData', data, errorback);
  },
  getTemplate(data, errorback) {
    return request._get('/shop/product.product_template/listData', data, errorback);
  },
  deleteTemplate(data, errorback) {
    return request._post('/shop/product.product_template/deleteData', data, errorback);
  },
  editShow(data, errorback) {
    return request._post('/shop/product.product_template/editShow', data, errorback);
  },
  productRecommend(data, errorback) {
    return request._get('/shop/product.recommend/list', data, errorback);
  },
  productRecommendAddList(data, errorback) {
    return request._post('/shop/product.recommend/addList', data, errorback);
  },
  productRecommendEditList(data, errorback) {
    return request._post('/shop/product.recommend/editList', data, errorback);
  },
  productRecommendDelList(data, errorback) {
    return request._post('/shop/product.recommend/delList', data, errorback);
  },

  getCommissionConfigList(data, errorback) {
    return request._get('/shop/statistics.supplier/getCommissionConfigList', data, errorback);
  },
  getRecommendProductlistData(data, errorback) {
    return request._get('/shop/product.recommend/getRecommendProductlistData', data, errorback);
  },

  createQrcode(data, errorback) {
    return request._post('/shop/product.product/createQrcode', data, errorback);
  },
}

export default ProductApi;
